
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>single_bubble_model.calculate_path &#8212; Texas A&amp;M Oil spill / Outfall Calculator 2.1.0 documentation</title>
    <link rel="stylesheet" href="../../_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="single_bubble_model.derivs" href="single_bubble_model.derivs.html" />
    <link rel="prev" title="single_bubble_model.ModelParams" href="single_bubble_model.ModelParams.html" />
   
  <link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="single-bubble-model-calculate-path">
<h1>single_bubble_model.calculate_path<a class="headerlink" href="#single-bubble-model-calculate-path" title="Permalink to this headline">¶</a></h1>
<dl class="function">
<dt id="single_bubble_model.calculate_path">
<code class="sig-prename descclassname">single_bubble_model.</code><code class="sig-name descname">calculate_path</code><span class="sig-paren">(</span><em class="sig-param">profile</em>, <em class="sig-param">particle</em>, <em class="sig-param">p</em>, <em class="sig-param">y0</em>, <em class="sig-param">delta_t</em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/single_bubble_model.html#calculate_path"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#single_bubble_model.calculate_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the trajectory of a particle</p>
<p>Calculate the trajectory of a particle by integrating its path using
the <cite>scipy.integrate.ode</cite> object and associated methods.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>profile</strong><span class="classifier"><cite>ambient.Profile</cite> object</span></dt><dd><p>Ambient CTD data for the model simulation</p>
</dd>
<dt><strong>particle</strong><span class="classifier"><cite>LagrangianParticle</cite> object</span></dt><dd><p>Object describing the properties and behavior of the particle.</p>
</dd>
<dt><strong>p</strong><span class="classifier"><cite>ModelParams</cite> object</span></dt><dd><p>Collection of model parameters passed to <cite>derivs</cite>.</p>
</dd>
<dt><strong>y0</strong><span class="classifier">ndarray</span></dt><dd><p>Initial values of the state space (depth in m, masses in kg, and heat
content in J of the particle) at the release point</p>
</dd>
<dt><strong>delta_t</strong><span class="classifier">float</span></dt><dd><p>Maximum step size (s) to take in the integration</p>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>The differential equation in <cite>derivs</cite> is written with respect to time, so
the independent variable in this simulation is time.  The vertical
coordinate; therefore, becomes a dependent variable, along with the masses
of each component in the particle and the particle temperature.  Thus,
the state space is:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">y</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">hstack</span><span class="p">((</span><span class="n">z0</span><span class="p">,</span> <span class="n">m0</span><span class="p">,</span> <span class="n">H0</span><span class="p">))</span>
</pre></div>
</div>
<p>where <cite>H0</cite> is the initial heat content, <cite>m_p * cp * T0</cite>.  The variables
in the state space can be returned by:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">seawater</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span> <span class="o">=</span> <span class="n">y</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">m</span> <span class="o">=</span> <span class="n">y</span><span class="p">[</span><span class="mi">3</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">T</span> <span class="o">=</span> <span class="n">y</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">/</span> <span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">y</span><span class="p">[</span><span class="mi">1</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span> <span class="o">*</span> <span class="n">particle</span><span class="o">.</span><span class="n">cp</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

</div>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="../../index.html">Texas A&M Oil spill / Outfall Calculator</a></h1>








<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../../user_manual.html">TAMOC User Manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../unit_tests.html">Unit Tests</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary.html">Glossary</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../bugs.html">Reporting Bugs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../readme.html">Read Me File</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../release.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../license.html">License</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="../../index.html">Documentation overview</a><ul>
  <li><a href="../../user_manual.html">TAMOC User Manual</a><ul>
  <li><a href="../../modules/sbm.html">Overview of Single Bubble Model Module</a><ul>
      <li>Previous: <a href="single_bubble_model.ModelParams.html" title="previous chapter">single_bubble_model.ModelParams</a></li>
      <li>Next: <a href="single_bubble_model.derivs.html" title="next chapter">single_bubble_model.derivs</a></li>
  </ul></li>
  </ul></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2020, Scott A. Socolofsky.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 2.4.4</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
      
      |
      <a href="../../_sources/autodoc/sbm/single_bubble_model.calculate_path.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>